#include <stdio.h>
#include <unistd.h>
#include <ctime>
#include <sys/time.h>
#include <iostream>
#include <stdlib.h>
#include "pinauth.h"
#include <string.h>
#include "macaddr.h"

using namespace std;

typedef long long u64;
/*
const char* GetDeviceUDID()
{
	char szComputerName[256];
	int cchComputerName = 256;

	GetComputerName(szComputerName, &cchComputerName);
	char* name = (char*)malloc(256);
	memset(name,0,256);
	sprintf(name,"%s",szComputerName);

	return name ;
}
*/
u64 GetTime()
{
	timeval tv;
	gettimeofday(&tv, NULL);
	u64 secMillis = (u64)tv.tv_sec * 1000;
	u64 milliseconds = secMillis + tv.tv_usec/1000;
	return milliseconds;
}

int main(int argc, char* argv[])
{
//	char str[64] = {0};
//	strncpy(str, getenv("IFF"), strlen(getenv("IFF")));
//	printf("IFF %d \n", getenv("IFF"));

//	while(true)
//	{
//		int ret = (int)checkPurchaseCode("1234");
//		printf("%d\n", ret);
//	}
	printf("%s\n", GetMacAddress("eth0"));
	printf("%lld\n", GetTime());

	return 0;
}
